

****In this .dofile:

* MAIN TEXT 
* 	1. General Models (TABLE 1)
* 	2. Interacted and Non-Interacted models (TABLE 2)
* 	3. Non-Strict versus Strict rules: Interacted and Non-Interacted models
* ONLINE APPENDIX
*	APPENDIX A - Distribution of the Dependent Variables
*   APPENDIX C - Balance Checks 
*   APPENDIX D - Non-Interacted Models, strict and non-strict 
*   APPENDIX E - Robustness Checks
*   APPENDIX F - Jackknife Resampling Results
*   APPENDIX G - Models Without "insider"


*************************

* 1. ANALYSIS

*************************

*svyset [pw=ipw]
svyset [iw=ipw]


**************************************
**************************************
* 1. General Models - TABLE 1:
**************************************
**************************************

svy: reg perf_economy cct ed male age income children13 urban insider i.pais 
eststo
svy: reg perf_corruption cct ed male age income children13 urban insider i.pais 
eststo
esttab using Table1.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear

*****************************************************
*****************************************************
* 2. Interacted and Non-Interacted models - TABLE 2:
*****************************************************
*****************************************************


*NonInteracted Model
svy: reg presidentperformance perf_economy perf_corruption cct ed male age income children13 urban insider i.pais  
eststo
svy: logit voteincumbent perf_economy perf_corruption cct ed male age income children13 urban insider i.pais  
eststo

*Interacted Model
svy: reg presidentperformance c.perf_economy##c.cct c.perf_corruption##c.cct  ed male age income children13 urban insider i.pais  
eststo
svy: logit voteincumbent c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider i.pais  
eststo
esttab using Table2.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear

**GRAPHS: 

* Presidential Performance
svy: reg presidentperformance  c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider i.pais  
margins, at(perf_economy=(1 2 3 4 5 6 7) cct=(0 1)) atmeans vsquish
marginsplot

svy: reg presidentperformance  c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider i.pais  
margins, at(perf_corruption=(1 2 3 4 5 6 7) cct=(0 1)) atmeans vsquish
marginsplot

graph combine Graph1.gph Graph2.gph

* Vote Incumbent 
svy: logit voteincumbent c.perf_economy##c.cct c.perf_corruption##c.cct  ed male age income children13 urban insider i.pais  
margins, at(perf_economy=(1 2 3 4 5 6 7) cct=(0 1)) atmeans vsquish
marginsplot

svy: logit voteincumbent c.perf_economy##c.cct c.perf_corruption##c.cct  ed male age income children13 urban insider i.pais  
margins, at(perf_corruption =(1 2 3 4 5 6 7) cct=(0 1)) atmeans vsquish
marginsplot

graph combine Graph3.gph Graph4.gph


*****************************************************
*****************************************************
* 3. Non-Strict versus Strict rules: 
*****************************************************
*****************************************************


svy: reg presidentperformance c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider i.pais if strict==0  
eststo
svy: reg presidentperformance c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider i.pais if strict==1  
eststo
svy: logit voteincumbent c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider i.pais  if strict==0
eststo
svy: logit voteincumbent c.perf_economy##c.cct c.perf_corruption##c.cct  ed male age income children13 urban insider i.pais if strict==1
eststo
esttab using Table3.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear

*Graph
svy: reg presidentperformance c.perf_economy##c.cct c.perf_corruption##c.cct  ed male age income children13 urban insider i.pais if strict==0  
margins, at(perf_economy=(1 2 3 4 5 6 7) cct=(0 1)) atmeans vsquish
marginsplot

svy: reg presidentperformance c.perf_economy##c.cct c.perf_corruption##c.cct  ed male age income children13 urban insider i.pais if strict==1  
margins, at(perf_economy=(1 2 3 4 5 6 7) cct=(0 1)) atmeans vsquish
marginsplot

graph combine Graph5.gph Graph6.gph



*****************************************************
*****************************************************
               *** ONLINE APPENDIX ***
*****************************************************
*****************************************************

*****************************************************
* APPENDIX A - Distribution of the Dependent Variables
*****************************************************


*FIGURE 1A
graph hbar (mean) economicsituation, over(pais, sort(1) descending)
*FIGURE 2A
graph hbar (mean) corruption, over(pais, sort(1) descending)
*FIGURE 3A
graph hbar (mean) presidentperformance, over(pais, sort(1) descending)
*FIGURE 4A
graph hbar (mean) voteincumbent, over(pais, sort(1) descending)

*****************************************************
*APPENDIX C. Balance Checks 
*****************************************************

**Add "p" at the end of the command to get p-value
pbalchk cct ed male age income children13 urban insider, p

** General Sample: 
pbalchk cct ed male age income children13 urban insider, graph

pbalchk cct ed male age income children13 urban insider, wt(cem_weights) graph

** Within countries:
*Mexico
pbalchk cct ed male age income children13 urban insider if pais==1
pbalchk cct ed male age income children13 urban insider if pais==1, wt(cem_weights) graph

*Guatemala
pbalchk cct ed male age income children13 urban insider if pais==2, p
pbalchk cct ed male age income children13 urban insider if pais==2, wt(cem_weights)
*El Salvador
pbalchk cct ed male age income children13 urban insider if pais==3,p

pbalchk cct ed male age income children13 urban insider if pais==3, wt(cem_weights)
*Honduras
pbalchk cct ed male age income children13 urban insider if pais==4,p

pbalchk cct ed male age income children13 urban insider if pais==4, wt(cem_weights)

*Costa Rica
pbalchk cct ed male age income children13 urban insider if pais==6, p 

pbalchk cct ed male age income children13 urban insider if pais==6, wt(cem_weights)

*Panama
pbalchk cct ed male age income children13 urban insider if pais==7,p

pbalchk cct ed male age income children13 urban insider if pais==7, wt(cem_weights)
*Colombia
pbalchk cct ed male age income children13 urban insider if pais==8,p

pbalchk cct ed male age income children13 urban insider if pais==8, wt(cem_weights) p
*Ecuador

pbalchk cct ed male age income children13 urban insider if pais==9,p
pbalchk cct ed male age income children13 urban insider if pais==9, wt(cem_weights)

*Bolivia
pbalchk cct ed male age income children13 urban insider if pais==10,p

pbalchk cct ed male age income children13 urban insider if pais==10, wt(cem_weights)
*Peru
*pbalchk cct ed male age income children13 urban insider if pais==11, wt(cem_weights)

*Paraguay
pbalchk cct ed male age income children13 urban insider if pais==12,p

pbalchk cct ed male age income children13 urban insider if pais==12, wt(cem_weights)
*Chile
pbalchk cct ed male age income children13 urban insider if pais==13,p

pbalchk cct ed male age income children13 urban insider if pais==13, wt(cem_weights)

*Uruguay
pbalchk cct ed male age income children13 urban insider if pais==14,p

pbalchk cct ed male age income children13 urban insider if pais==14, wt(cem_weights)
*Brazil
pbalchk cct ed male age income children13 urban insider if pais==15,p

pbalchk cct ed male age income children13 urban insider if pais==15, wt(cem_weights)
*Argentina

pbalchk cct ed male age income children13 urban insider if pais==17,p

pbalchk cct ed male age income children13 urban insider if pais==17, wt(cem_weights)
*Dom Republic
pbalchk cct ed male age income children13 urban insider if pais==21,p

pbalchk cct ed male age income children13 urban insider if pais==21, wt(cem_weights)



***********************************************************
* APPENDIX D - NON-INTERACTED MODELS STRICT AND NON STRICT
***********************************************************

svy: reg presidentperformance perf_economy perf_corruption cct ed male age income children13 urban insider i.pais if strict==0 
eststo
svy: reg presidentperformance perf_economy perf_corruption cct ed male age income children13 urban insider i.pais if strict==1 
eststo
svy: logit voteincumbent perf_economy perf_corruption cct ed male age income children13 urban insider i.pais if strict==0 
eststo
svy: logit voteincumbent perf_economy perf_corruption cct ed male age income children13 urban insider i.pais if strict==1
eststo
esttab using AppendixD.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear


*****************************************************
* APPENDIX E - ROBUSTNESS CHECKS
*REPLICATION ALL MODELS W TRADITIONAL MEASURES (NON-PERFORMANCE)
*****************************************************

* General Models - TABLE 1E:

svy:reg economicsituation cct ed male age income children13 urban insider i.pais 
eststo
svy: reg corruption cct ed male age income children13 urban insider i.pais 
eststo
esttab using Table1E.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear


* Interacted and Non-Interacted models - TABLE 2:

*Non-interacted:
svy: reg presidentperformance economicsituation corruption cct ed male age income children13 urban insider i.pais  
eststo
svy: logit voteincumbent economicsituation corruption cct ed male age income children13 urban insider i.pais  
eststo

*Interacted Model
svy: reg presidentperformance  c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais  
eststo
svy: logit voteincumbent c.economicsituation##c.cct c.corruption##c.cct  ed male age income children13 urban insider i.pais  
eststo
esttab using Table2E.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear


*** GRAPHS ***

* Presidential Performance
svy: reg presidentperformance  c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais  
margins, at(economicsituation=(1 2 3) cct=(0 1)) atmeans vsquish
marginsplot

svy: reg presidentperformance  c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais  
margins, at(corruption=(1 2 3 4) cct=(0 1)) atmeans vsquish
marginsplot

graph combine Graph1E.gph Graph2E.gph

* Vote Incumbent 
svy: logit voteincumbent c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais  
margins, at(economicsituation=(1 2 3) cct=(0 1)) atmeans vsquish
marginsplot

svy: logit voteincumbent c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais  
margins, at(corruption=(1 2 3 4) cct=(0 1)) atmeans vsquish
marginsplot

graph combine Graph3E.gph Graph4E.gph


* Non-Strict & Strict rules - TABLE 3E: 
svy: reg presidentperformance   c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais  if strict==0
eststo
svy: reg presidentperformance  c.economicsituation##c.cct c.corruption##c.cct  ed male age income children13 urban insider i.pais  if strict==1
eststo
svy: logit voteincumbent c.economicsituation##c.cct c.corruption##c.cct   ed male age income children13 urban insider i.pais  if strict==0
eststo
svy: logit voteincumbent  c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais  if strict==1
eststo
esttab using Table3E.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear

*Graph
svy: reg presidentperformance c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais if strict==0  
margins, at(economicsituation=(1 2 3) cct=(0 1)) atmeans vsquish
marginsplot

svy: reg presidentperformance c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais if strict==1  
margins, at(economicsituation=(1 2 3) cct=(0 1)) atmeans vsquish
marginsplot

graph combine Graph5E.gph Graph6E.gph

svy: logit voteincumbent c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais if strict==0  
margins, at(economicsituation=(1 2 3) cct=(0 1)) atmeans vsquish
marginsplot

svy: reg voteincumbent c.economicsituation##c.cct c.corruption##c.cct ed male age income children13 urban insider i.pais if strict==1  
margins, at(economicsituation =(1 2 3) cct=(0 1)) atmeans vsquish
marginsplot

graph combine Graph7E.gph Graph8E.gph



*****************************************************
* APPENDIX F - JACKNIFING  
*****************************************************

* Non-Strict & Strict rules: 

jackknife, cluster (pais): reg presidentperformance  c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider if strict==0 [pw=ipw] 
eststo
jackknife, cluster (pais): reg presidentperformance c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider if strict==1 [pw=ipw] 
eststo
jackknife, cluster (pais): reg voteincumbent c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider  if strict==0 [pw=ipw]
eststo
jackknife, cluster (pais): reg voteincumbent c.perf_economy##c.cct c.perf_corruption##c.cct  ed male age income children13 urban insider if strict==1 [pw=ipw]
eststo
esttab using Table1F.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear


*****************************************************
* APPENDIX G - MODELS WITHOUT "INSIDER"
*****************************************************

* General Models - TABLE 1G:

svy: reg perf_economy cct ed male age income children13 urban i.pais 
eststo
svy: reg perf_corruption cct ed male age income children13 urban i.pais 
eststo
esttab using Table1G.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear

* Interacted and Non-Interacted models - TABLE 2G:


*NonInteracted Model

svy: reg presidentperformance perf_economy perf_corruption cct ed male age income children13 urban i.pais  
eststo
svy: logit voteincumbent perf_economy perf_corruption cct ed male age income children13 urban i.pais  
eststo

*Interacted Model
svy: reg presidentperformance c.perf_economy##c.cct c.perf_corruption##c.cct  ed male age income children13 urban i.pais  
eststo
svy: logit voteincumbent  c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban i.pais  
eststo
esttab using Table2G.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear


*Strict Versus Non-Strict

svy: reg presidentperformance c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban insider i.pais if strict==0  
eststo
svy: reg presidentperformance c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban i.pais if strict==1  
eststo
svy: logit voteincumbent c.perf_economy##c.cct c.perf_corruption##c.cct ed male age income children13 urban i.pais  if strict==0
eststo
svy: logit voteincumbent c.perf_economy##c.cct c.perf_corruption##c.cct  ed male age income children13 urban i.pais if strict==1
eststo
esttab using Table3G.rtf, star(+ 0.10 * 0.05 ** 0.01 *** 0.001) se(3)
eststo clear

